#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<unordered_map>
#include<unordered_set>
#define int long long 
#define x first 
#define y second 
using namespace std;
const int N = 2e5 + 10;
int a[N],b[N];
int sum1 = 0;
int sum2 = 0;
void solve()
{
    int n;
    cin >> n;
    for(int i = 0; i < n; i++) 
    {
        cin >> a[i];
        sum1 += a[i];
    }
    for(int i = 0; i < n; i++) 
    {
      cin >> b[i];
      sum2 += b[i];
    }
    cout << ceil((sum1+sum2)*1.0/2.0) << endl;
}
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int t = 1;
    while(t--) solve();
    return 0;
}